A[i] * A[j] = k in O(nlog(n))

Posted by gleb-pendler on Stack Overflow See other posts from Stack Overflow or by gleb-pendler
Published on 2010-06-10T00:47:27Z Indexed on 2010/06/10 0:52 UTC
Read the original article Hit count: 330

A is an Array of n positive int numbers k given int

Algorithm should find if there is a pair of numbers which product gives the result a. A[i] * A[j] = k b. A[i] = A[j] + k

if there is such a couple the algorithm should return thier index.

thanks in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about algorithm